// 路由规则 和 实例化路由对象
import Vue from 'vue';
import VueRouter from 'vue-router';

import Home from '@/components/Home.vue';
import Detail from '@/components/Detail.vue';
import Login from '@/components/Login.vue';
import Movie from '@/components/Movie.vue';
import Cinema from '@/components/Cinema.vue'

Vue.use(VueRouter);

export default new VueRouter({
    routes: [
        {   
            // 首页
            path: '/home',
            name:'home',
            component: Home
        },
        {
            // 详情
            path: '/film/:id',
            name: 'detail',
            component: Detail
        },
        {
            // 登录
            path: '/login',
            name:'login',
            component: Login
        },
        {
            //影片
            path:'/movie',
            name:'movie',
            component:Movie
        },
        {
            //影院
			path:'/cinema',
			name:'cinema',
			component:Cinema
		},
        {
            path: '*',
            redirect: '/home'
        }
    ]
})